/*******************************************************************
 * author   :  Charlies-ls
 * Date     :  2021-09-26
 * Function :  filesystem tools
 * Copyright (c) 2021. artestplay@outlook.com. All Rights Reserved.
 *******************************************************************/

#ifndef AX_FILESYSTEM_H
#define AX_FILESYSTEM_H
#include <stdio.h>
#include <stdbool.h>
#include <inttypes.h>
#include "ax_list.h"

#ifdef __cplusplus
extern "C"
{
#endif
    bool ax_exists(const char* path);

    bool ax_directory_create(const char* path, bool p);
    bool ax_directory_copy(const char* dst, const char* src);
    bool ax_directory_move(const char* dst, const char* src);
    ax_list* ax_directory_files(const char* path);
    ax_list* ax_directory_directorys(const char* path);
    uint64_t ax_directory_size(const char* path);

    bool ax_file_create(const char* path);
    bool ax_file_copy(const char* dst, const char* src);
    bool ax_file_remove(const char* path);
    bool ax_file_move(const char* dst, const char* src);
    bool ax_file_rename(const char* dst, const char* src);
    FILE*ax_file_create_temp();
    const char* ax_file_temp_name(char* buf);
    uint64_t ax_file_size(const char* path);

    bool ax_symlink_copy(const char* dst, const char* src);
#ifdef __cplusplus
}
#endif

#define MAX_PATH 512

#endif // AX_FILESYSTEM_H
